import Main from '../views/main';
// 不作为Main组件的子页面展示的页面单独写，如下
// 首页组件必须以下面的形式来写，否则到时候会导致报错，会显示多个主页
export default [
    {
        path: '/api/login',
        name: 'login',
        meta: {
            title: 'Login - 登录',
            hideInMenu: true,
            icon: 'ios-book'
        },
        component: resolve => {
            require(['../views/login/login.vue'], resolve);
        }
    },
    {
        path: '/',
        name: '_home',
        redirect: '/api/home',
        component:Main,
        meta: {
            hideInMenu: true,
            notCache: true
        },
        children: [
            {
                path: '/api/home',
                name: 'home',
                meta: {
                    hideInMenu: true,
                    title: '首页',
                    notCache: true
                },
                component: resolve => {
                    require(['../views/home/home.vue'], resolve);
                }
            }
        ]
    },
    {
        path: '/components',
        name: 'components',
        meta: {
            icon: 'logo-buffer',
            title: '组件'
        },
        component: Main,
        children: [
            {
                path: 'dict',
                name: 'dict',
                meta: {
                    icon: 'md-trending-up',
                    title: '数据字典'
                },
                component: resolve => {
                    require(['../views/dict/dict.vue'], resolve);
                }
            }
        ]
    },
    {
        path: '/api/index',
        name: 'index',
        meta: {
            title: 'Login1 - 登录',
            hideInMenu: false,
            icon: 'ios-book'
        },
        component: resolve => {
            require(['../views/index.vue'], resolve);
        }
    }
];

